package net.rock.eshop.mapper;

import net.rock.eshop.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface UserMapper {
    User fetchUserById(int id);
    User fetchUserByName(String name);
    User fetchUserBySessionId(String sessionId);

    void register(User user);

    void logoutAll(int userId);

    void login(@Param("sessionId") String sessionId, @Param("userId") Integer userId);
    void logout(String sessionId);
}
